
import 'package:flutter/cupertino.dart';
import 'package:islandingclub/utils/screen_utils.dart';

extension NumberExtensions on num {
  num get w => ScreenUtils.setWidth(this);

  num get h => ScreenUtils.setHeight(this);

  num get sp => ScreenUtils.setFontSize(this);

  num get ssp => ScreenUtils.setFontSize(this, allowFontScalingSelf: true);

  num get nsp => ScreenUtils.setFontSize(this, allowFontScalingSelf: false);
}

extension StringExtensions on String {
  toColor() {
    var hexColor = this.replaceAll("#", "");
    if (hexColor.length == 6) {
      hexColor = "FF$hexColor";
      return Color(int.parse("0x$hexColor"));
    }
  }
}